type useModel = (options: Options) => void;
import { createApp, reactive } from "vue";
import Model from "./Model.vue";
export interface Options {
  titel: string;
  context?: string;
  custom?: string;
  okText?: string;
  cancelText?: string;
  blank?: string;
  hiddenCancel?: boolean;
  onOk?: () => boolean | undefined;
  onCancel?: () => boolean | undefined;
}

export type optionsArr = Array<Options>;
const modelArr = reactive<optionsArr>([]);
const pushArr = (options: Options) => modelArr.push(options);
const messageNode = document.createElement("div");
document.body.appendChild(messageNode);
createApp(Model, {
  modelArr,
}).mount(messageNode);

const useModel: useModel = (options: Options) => pushArr(options);

export { useModel };
